Skip to content

Conversation

andreyvolokitin
Copy link
Contributor

Remove whitespace at the start/end of the first/last text node. Related: posthtml/posthtml-include#19.

I realized that for posthtml-extend it makes sense to remove not only line breaks but all whitespace instead. Because it can interfere with formatting, when actual html is inside multiple nested control tags, i.e. <block> inside <extends>:

<extends src="foo.html">
    <block name="bar">
        << Parasitic whitespace to the left (as well as a line break above and below)
    </block>
</extends>

If there is whitespace in the middle of a string, then it remains untouched and definitely should be handled by html beautifier later:

<extends src="foo.html">
    <block name="bar">
        << Parasitic whitespace to the left (as well as a line break  above and below).
        << Parasitic whitespace to the left again, this time it gets inserted to the actual output
    </block>
</extends>

Remove whitespace at the start/end of the first/last text node. Details: posthtml/posthtml-include#19
@Scrum Scrum added the feat label Sep 10, 2018
@Scrum Scrum added this to the 0.12.0 milestone Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants